# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
maintainer="Patrycja Rosa <alpine@ptrcnull.me>"
pkgname=py3-tokenizers
pkgver=0.20.3
pkgrel=0
pkgdesc="Fast State-of-the-Art Tokenizers optimized for Research and Production"
url="https://github.com/huggingface/tokenizers"
arch="all !s390x !riscv64 !loongarch64" # blocked by rust
license="Apache-2.0"
depends="python3"
makedepends="
	bzip2-dev
	cargo
	openssl-dev>3
	py3-gpep517
	py3-maturin
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/huggingface/tokenizers/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/tokenizers-$pkgver/bindings/python"
options="net !check" # requires pulling test data


build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/tokenizers*.whl
}

sha512sums="
a4f7d66cbbbf9fd5705c1b6a476e707a1d5a2a8da1e34270ccac79e9ca97e4354dd04c4153215f630151619a45000f7e984da1d479583fe00e298420a74706ec  py3-tokenizers-0.20.3.tar.gz
"
